package com.fz.mapper;

import com.fz.entity.Book;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

/**
 * Created by webrx on 2017-08-23.
 */
public interface BookMapper {

    @Insert("insert into book values(null,#{name},#{price},#{bdate})")
    public int insert(Book book);

    @Select("select * from book")
    public List<Book> queryall();

    @Insert("insert into book values(null,#{name},#{price},null)")
    public int save(Map<String,Object> map);


    @Insert("insert into book values(null,#{n},#{p},null)")
    public int saves(@Param("n") String name, @Param("p") double price);
}
